<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Encrypt
 *
 * @author nmthong
 */
class PITEncrypt {


    /**
     * Returns an encrypted & utf8-encoded
     */
    function encrypt($pure_string,$times) {
        $encrypted_string=$pure_string;
        for($i=0;$i<$times;$i++){
            $encrypted_string =base64_encode($encrypted_string);
        }
        return $encrypted_string;
    }

    /**
     * Returns decrypted original string
     */
    function decrypt($encrypted_string,$times) {
        $decrypted_string=$encrypted_string;
        for($i=0;$i<$times;$i++){
            $decrypted_string =base64_decode($decrypted_string);
        }
        return $decrypted_string;
    }
    
}

?>
